{include file="public/layout" /}

<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;min-width:400px;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="flexigrid pb30 member_lt">
        <div class="mDiv pt0">
            <div class="ftitle_nav">
                {volist name='$levelCountList' id='vo'}
                <div class="fbutton">
                    <a href="{:url('UsersNotice/select_users', ['level'=>$vo.level_id])}">
                        <div class="{eq name='$Request.param.level' value='$vo.level_id'}cur{/eq}">
                            {$vo.level_name}<span>{$vo.level_count}</span>
                        </div>
                    </a>
                </div>
                {/volist}
            </div>
            <form class="navbar-form form-inline" id="searchForm" action="{:url('UsersNotice/select_users')}" method="get" onsubmit="layer_loading('正在处理');">
                {$searchform.hidden|default=''}
                <div class="sDiv">

                    <div class="sDiv2" style="margin: 0 6px;">
                        <input type="text" size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="搜索用户名...">
                        <input type="submit" class="btn" value="搜索">
                        <i class="iconfont e-sousuo"></i>
                    </div>
                </div>
            </form>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                    <tr>
                        <th class="sign w40" axis="col0">
                            <div class="tc"><input type="checkbox" autocomplete="off" class="checkAll"></div>
                        </th>
                        <th abbr="article_title" axis="col3" class="w40">
                            <div class="tc">ID</div>
                        </th>
                        <th abbr="article_title" axis="col3" class="w50">
                            <div class="tc">头像</div>
                        </th>
                        <th abbr="ac_id" axis="col4">
                            <div class="tl text-l10">昵称/绑定</div>
                        </th>
                        <th abbr="ac_id" axis="col4" class="w100">
                            <div class="tc">级别</div>
                        </th>
                        <th abbr="ac_id" axis="col4" class="w150">
                            <div class="tc">注册</div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                    {empty name="list"}
                    <tr>
                        <td class="no-data" align="center" axis="col0" colspan="50">
                            <div class="no_row">
                                <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
                            </div>
                        </td>
                    </tr>
                    {else/}
                    {foreach name="list" item="vo" key="k" }
                    <tr>
                        <td class="sign">
                            <div class="w40 tc">
                                <input type="checkbox" autocomplete="off" name="ids[]" value="{$vo.users_id}" id="input_u_{$vo.users_id}" >
                            </div>
                        </td>
                        <td class="sort">
                            <div class="w40 tc">{$vo.users_id}</div>
                        </td>
                        <td class="sign">
                            <div class="w50 tc">
                                <img id="img_head_pic" style="height: 40px;margin-right: 5px;float: unset;margin: auto;" src="{$vo.head_pic|get_head_pic=###,false,$vo['sex']}" />
                            </div>
                        </td>
                        <td style="width: 100%">
                            <div class="text-l10">
                                <p style="margin-top: -5px;">
                                    {eq name="'Member@users_edit'|is_check_access" value="1"}
                                    <a href="{:url('Member/syn_users_login', ['users_id'=>$vo.users_id, 'mca'=>'user/Users/index'])}" target="_blank">{$vo.nickname|default=$vo.username}</a>
                                    {else /}
                                    {$vo.nickname|default=$vo.username}
                                    {/eq}
                                </p>

                                <p class="binding">
                                    {eq name='$vo.is_mobile' value='1'}
                                    <img src="__STATIC__/admin/images/r_phone.png">
                                    {/eq}
                                    {if condition="in_array($vo['thirdparty'], [5]) || !empty($wxlogin[$vo['users_id']]['openid'])"}
                                    <img src="__STATIC__/admin/images/r_weixin.png">
                                    {/if}
                                    {if condition="in_array($vo['thirdparty'], [6])"}
                                    <img src="__STATIC__/admin/images/r_wechat.png">
                                    {/if}
                                    {if condition="!empty($qqlogin[$vo['users_id']])"}
                                    <img src="__STATIC__/admin/images/r_qq.png">
                                    {/if}
                                    {if condition="in_array($vo['thirdparty'], [4])"}
                                    <img src="__STATIC__/admin/images/r_wxapp.png">
                                    {/if}
                                    {if condition="!empty($wblogin[$vo['users_id']])"}
                                    <img src="__STATIC__/admin/images/r_wb.png">
                                    {/if}
                                </p>
                            </div>
                        </td>

                        <td>
                            <div class="w100 tc">
                                <p>{$vo.level_name}</p>
                            </div>
                        </td>
                        <td>
                            <div class="w150 tc">
                                <p>{$vo.reg_time|MyDate='Y-m-d H:i:s',###}</p>
                            </div>
                        </td>
                    </tr>
                    {/foreach}
                    {/empty}
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        <div class="tDiv">
            <div class="tDiv2">
                <div class="fbutton checkboxall"><input type="checkbox" class="checkAll"></div>
                <div class="fbuttonr">{include file="public/page" /}</div>
            </div>
            <div style="clear:both"></div>
        </div>
        <div class="bot3 wm100">
            <div class="item-selected">已选择<font id="selectLength" color="red">0</font>个</div>
            <a href="javascript:void(0);" onclick="parent.submitUsersSelect();" class="ncap-btn-big ncap-btn-green"><span>确认</span></a>
            <a class="ncap-btn-big ncap-btn-no" href="javascript:void(0);" onclick="parent.closeUsersSelect(true);" title="关闭">关闭</a>
        </div>
    </div>
</div>
<script>
    $(function(){
        $('#selectLength').text(parent.usersID.length);
        $('input[name*=ids]').click(function(){
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked','checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
            if (this.checked) {
                parent.usersSelect(this, 'add');
            } else {
                parent.usersSelect(this, 'cut');
            }
            $('#selectLength').text(parent.usersID.length);
        });
        $('input[type=checkbox].checkAll').click(function(){
            $('input[type=checkbox]').prop('checked',this.checked);
            $("input[name*=ids]").each(function(index, item){
                if (this.checked) {
                    parent.usersSelect(item, 'add');
                } else {
                    parent.usersSelect(item, 'cut');
                }
            });
            $('#selectLength').text(parent.usersID.length);
        });

        if (parent.usersID.length > 0) {
            $.each(parent.usersID, function(index, val){
                if ($('#input_u_'+val)) {
                    $('#input_u_'+val).attr('checked','checked');
                }
            });
        }
    });
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function(){
            $(this).toggleClass('trSelected');
        });
    });
</script>

{include file="public/footer" /}